#!/bin/bash
# 独立的机器提供离线安装

#k8s dashboard涉及的镜像
# https://gitee.com/wushifeng/kubernetes-dashboard/blob/v2.0.0-rc4/aio/deploy/recommended.yaml
docker pull kubernetesui/dashboard:v2.0.0-rc4
docker pull kubernetesui/metrics-scraper:v1.0.3

docker tag kubernetesui/dashboard:v2.0.0-rc4 dockerhub.kubekey.local/kubernetesui/dashboard:v2.0.0-rc4
docker tag kubernetesui/metrics-scraper:v1.0.3 dockerhub.kubekey.local/kubernetesui/metrics-scraper:v1.0.3

#
docker push dockerhub.kubekey.local/kubernetesui/dashboard:v2.0.0-rc4
docker push dockerhub.kubekey.local/kubernetesui/metrics-scraper:v1.0.3

# https://dockerhub.kubekey.local/v2/_catalog 就会包含 kubernetesui

echo "在需要安装的机器上执行kubectl apply -f dashboard.yaml"
:<<EOF
kubectl get svc -n kubernetes-dashboard

EOF
